/* 
 * File:   Game.h
 * Author: agu
 *
 * Created on 22 de mayo de 2014, 14:45
 */

#ifndef GAME_H
#define	GAME_H
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <vector>
#include "Window.h"
#include "InitializationException.h"
#include "Animation.h"
#include "Runner.h"
using std::vector;
class Game:public Runner {
public:

    Game(string name);
    Game(Window& windows,SDL_Renderer* renderer);
    ~Game();
    void init();
    void run();
private:
    Window window;
    SDL_Renderer* renderer;
    SDL_Event m_evento;
    vector<Texture*> items;//Items como cajas?
    Animation* player;//Personajes
    Texture* wall;//Por ahora el fondo lo mantengo como una imagen
    SDL_Event event;
    bool runnig;
    void input();    
    void handleEvent();
    void update();
    void render();
    void loadGraphics();
    void loadMap();
    void loadAnimations();
    void updateMovements();
    void updateMap();
    void renderMap();
    void renderAnimations();
    void freeMap();
    void freeAnimations();
    void free();
    

};

#endif	/* GAME_H */

